package com.chen.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chen.entity.Role;

import com.chen.entity.UserRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@SuppressWarnings("all")
@Mapper
public interface RoleMapper extends BaseMapper<Role> {

    //查询所有的角色信息
    @Select("select *from user_role where user_id=#{userId}")
    List<UserRole> getByUserRoleUserId(int userId);


    @Select("select *from role where id=#{userId}")
    List<UserRole> getByUserId(int roleId);

}
